<%@page import="java.util.ArrayList"%>
<%@page import="com.mconnect.msurvey.model.SurveyPlan"%>
<%@page import="java.util.List"%>
<%@page import="com.mconnect.msurvey.controller.PlanManager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
      <%@ taglib prefix="s" uri="/struts-tags"%>
<%// w celu poprawnie dzialajacej sesji:
response.setHeader("Cache-Control","no-store"); 
response.setHeader("Pragma","no-cache"); 
response.setDateHeader ("Expires", 0); 
%>     
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
	  <title>Panel Admina</title>
	<link rel="stylesheet" href="resources/css/ap.css">
  	<link rel="stylesheet" href="js/jQuery/themes/base/jquery.ui.all.css">
  	<link rel="stylesheet" href="js/jQuery/demos.css">
  	<link rel="stylesheet" href="resources/css/detail_style.css">
	<script src="js/jQuery/jquery-1.8.2.js"></script>
	<script src="js/jQuery/ui/jquery.ui.core.js"></script>

<script type="text/javascript">
		$(function() {
		$('#choosePlan').click(function(){
				var id_plan = $( "#id_plan" ).val();
				$.get(
						'campaigns/priceListContent.jsp',
						{
							id_plan: id_plan
						},
						function (content) {
							$('#content').html(content);
							return false;
						}
					);
			});
		});
</script>
	
  </head>
<body>
	<center>
		
		<% PlanManager pM = new PlanManager();
			List<SurveyPlan> planList = new ArrayList<SurveyPlan>();
			planList = pM.getPlanList();
		%>
			<center>
				<h2>Cennik</h2>
				<div id="content1" style=" margin-top: 30px; margin-bottom: 30px; width: 700px; font-size: 12px; ">
						
					<table style="margin-top: 30px;">
						<tr>
							<td width="130px;" style="font-size: 12px;">Wybierz kampanie</td>
							<td width="120px;">
								<select name="id_plan" id="id_plan"  >
								<% for(SurveyPlan plan : planList){ %>
									<option value="<%=plan.getId_plan() %>"><%= plan.getPlanName() %></option>
									
								<%} %>
								</select>
							</td>
							<td><input type="submit" value="Wyszukaj" style="width: 100px; height: 30px;" id="choosePlan"></td>
						</tr>
					</table>
				
				</div>
				
				<div id="content">
				
				</div>
		</center>
		
	</center>
</body>
</html>